package com.ruoyi.web.controller.system;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.system.domain.RequestLog;
import com.ruoyi.system.domain.vo.RequestLogPageInfo;
import com.ruoyi.system.service.RequestLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

import static com.ruoyi.common.utils.PageUtils.startPage;

@RestController
@RequestMapping("/requestlog")
@Api(tags = "请求日志管理", description = "请求日志管理")
public class RequestLogController extends BaseController {

    @Autowired
    RequestLogService requestLogService;

    @ApiOperation(value = "分页查询")
    @PostMapping("/getRequestlogPage")
    public TableDataInfo test(@RequestBody RequestLogPageInfo requestLogPageInfo , @RequestParam Integer pageNum,@RequestParam Integer pageSize) {
        List<RequestLog> list = requestLogService.getRequestlogPage(requestLogPageInfo ,pageNum,pageSize);
        Long total = requestLogService.getRequestlogCount(requestLogPageInfo);
        return getDataTable(list,total);
    }
}
